---
title: "SQL-VP-001: Retrieve agency/agent record for a policy"
summary: Retrieves agency/agent contact information for a policy via the Oracle view-policy package.
status: draft
owner: SAIF Claims BOF team
last_reviewed: 2026-08-21
library: SAIF.Business.View.Policy
reference_type: embedded
---

# SQL-VP-001 Retrieve agency agent record for a policy

Retrieves the agency/agent contact and address record associated with a policy, used by `clsAgency`
as its principal (and only) retrieval path.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-VP-001 |
| **Operation type** | Read |
| **Execution method** | Stored procedure |
| **Database** | Oracle |
| **Schema** | `[unqualified]**` |
| **Command type** | StoredProcedure |
| **Business object** | `clsAgency` |
| **Criteria property** | `RetrieveSQL` |
| **Lifecycle method** | `BeforeRetrieve` / `AfterRetrieve` |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `apolicynum` | Input | Decimal | N/A | Policy number to look up the agency/agent for. |
| `recordset` | Output (Cursor) | REF CURSOR | N/A | Result set containing the agency/agent record. |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| *(not directly visible — encapsulated in procedure body)* | SELECT | N/A |

## Sample SQL

```sql
BEGIN
  pk72846_view_policy.getAgency(
    apolicynum => :apolicynum,
    recordset  => :recordset
  );
END;
```

*Call signature reconstructed from `DataRequest.SQLStatement`/`AddParm`/`AddCursorParm` calls; the
procedure body resides in the Oracle database and was not retrieved this run.*

## Business rules
- [BR-VP-010: Demo-user agency/agent data masking](../business-rules.md#br-vp-010-demo-user-agency-agent-data-masking)

> **Note:** Statements marked with `*` were inferred from code structure, naming
> conventions, or contextual evidence where direct confirmation was not available
> in source artifacts. Statements marked with `**` could not be confirmed; treat
> as unknown until verified.

## Sources
- `SAIF.Business.View.Policy\clsAgency.vb`
